﻿
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Ease Template Manual - SYSTN.COM</title>
<style>
<!--

td { font-family:Verdana, Arial, Helvetica, sans-serif; font-size:13px; color:#000000   }
.style8 {
background-color: #FFFFFF;
}

p { font-family:Verdana, Arial, Helvetica, sans-serif; font-size:13px; color:#000000   }
.style10 {
font-size: 9px;
font-family: "Arial Unicode MS";
text-align: right;
}
-->
</style>
</head>

<table class="style4" style="WIDTH: 100%" cellSpacing="0" cellPadding="0" border="0" id="table1">
	<tr>
		<td class="style8">
		<table style="WIDTH: 100%" cellSpacing="8" cellPadding="8" border="0" id="table2">
			<tr>
				<td style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: #000000">
				<table id="table3" style="BORDER-COLLAPSE: collapse" borderColor="#808080" cellPadding="4" width="100%" align="left" border="0">
					<tr>
						<td vAlign="top" colSpan="2" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: #000000">
						<font style="FONT-SIZE: 30px" color="#94a7b1">
						<font face="Arial">Ease Template Manual</font> </font>
						<font style="FONT-SIZE: 10px" face="Arial" color="#94a7b1">
						Version:E3</font></td>
					</tr>
					<tr>
						<td vAlign="top" width="4" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: #000000">　</td>
						<td vAlign="top" align="left" width="98%" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: #000000">
						<table class="TableBorder" cellSpacing="1" cellPadding="0" width="100%" border="0" id="table5">
							<tr>
								<td class="TableMiddle">如何开发多语言网站？<br>
								这个问题对于很多程序员来说是既头疼又不好解决的问题。Ease Template 
								为程序员量身打造了多语言功能。只需在需要翻译的文字上定义标签即可记录在语言包中，就算一段很长的文字也能定义到语言包且不用担心语言包过大，因为Ease 
								Template会自动将过大的语言包分成不同的小语言包，读取的时候会自动载入。默认语言包会写入当前程序目录下的language目录。没有写入权限的时候程序会放弃建立语言包。<br>
								<br>
								语言包结构讲解：例如下面“Ease Template 
								非常棒!”这段文字，记录在语言包中由注释语句、校验数据及翻译语句组成。<br>
								注释语句第一句为记录日期，第二行为原始语言文字，翻译人员可以对比来进行翻译。<br>
								/**2008.07.06<br>
								Ease Template 非常棒!<br>
								*/<br>
								$lang[&quot;7ec49c5eb48abf8293354daedb9e2820&quot;] = 
								&quot;Ease Template 非常棒!&quot;;<br>
								<br>
								翻译好数据如下：<br>
								/**2008.07.06<br>
								Ease Template 非常棒!<br>
								*/<br>
								$lang[&quot;7ec49c5eb48abf8293354daedb9e2820&quot;] = 
								&quot;Ease Template Very Good!&quot;;<br>
								<br>
								当语言包翻译完成后将名称修改为：en.php，这样就可以在两种语言之间切换。下面示例提供切换演示效果：<br>
								<br>
								test_15.php<br>
　<ol style="text-align: left; margin: 0px; padding-left: 40px; padding-right: 1px; padding-top: 1px; padding-bottom: 1px; background: #e1e7f0">
									<li style="background: #ffffff url('images/code_bg.gif')">
									<code><span style="COLOR: #000000">
									<span style="COLOR: #0000bb">&lt;?php &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #007700">include</span><span style="COLOR: #dd0000">&quot;./template.ease.php&quot;</span><span style="COLOR: #007700">; 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #ff8000">//获得语言类型 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #0000bb">$lang&nbsp;</span><span style="COLOR: #007700">=&nbsp;</span><span style="COLOR: #0000bb">$_GET</span><span style="COLOR: #007700">[</span><span style="COLOR: #dd0000">'lang'</span><span style="COLOR: #007700">]; 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									if(</span><span style="COLOR: #0000bb">$lang</span><span style="COLOR: #007700">==</span><span style="COLOR: #dd0000">'en'</span><span style="COLOR: #007700">)<font color="#007700">{ 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&nbsp;&nbsp;&nbsp;</font></span><font color="#007700"><span style="COLOR: #0000bb">$lang&nbsp;</span><span style="COLOR: #007700">=&nbsp;</span><span style="COLOR: #dd0000">'en'</span><span style="COLOR: #007700">; 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									}</span></font><span style="COLOR: #007700">else<font color="#007700">{ 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&nbsp;&nbsp;&nbsp;</font></span><font color="#007700"><span style="COLOR: #0000bb">$lang&nbsp;</span><span style="COLOR: #007700">=&nbsp;</span><span style="COLOR: #dd0000">'default'</span><span style="COLOR: #007700">; 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									}</span></font><span style="COLOR: #007700"> 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;
									</li>
									</span>
									<li style="background: #ffffff url('images/code_bg.gif')">
									<span style="COLOR: #0000bb">$tpl&nbsp;</span><span style="COLOR: #007700">=&nbsp;new&nbsp;</span><span style="COLOR: #0000bb">template</span><span style="COLOR: #007700">( 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&nbsp;&nbsp;&nbsp;array( &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #dd0000">'LangDir'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #007700">=&gt;</span><span style="COLOR: #dd0000">'language'&nbsp;</span><span style="COLOR: #007700">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #ff8000">//语言文件存放的目录 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #dd0000">'Language'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #007700">=&gt;</span><span style="COLOR: #0000bb">$lang&nbsp;</span><span style="COLOR: #007700">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #ff8000">//语言的默认文件 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #007700">) &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									); &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									echo&nbsp;</span><span style="COLOR: #0000bb">$tpl</span><span style="COLOR: #007700">-&gt;</span><span style="COLOR: #0000bb">lang</span><span style="COLOR: #007700">(</span><span style="COLOR: #dd0000">'中国加油!'</span><span style="COLOR: #007700">); 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #0000bb">$tpl</span><span style="COLOR: #007700">-&gt;</span><span style="COLOR: #0000bb">set_file</span><span style="COLOR: #007700">(</span><span style="COLOR: #dd0000">'test_15'</span><span style="COLOR: #007700">); 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #0000bb">$tpl</span><span style="COLOR: #007700">-&gt;</span><span style="COLOR: #0000bb">p</span><span style="COLOR: #007700">(); 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #0000bb">?&gt;</span>
									</span></code></li>
								</ol>
								<br>
								<br>
								模板中载入了语言标签，下面提供两个切换语言的链接：<br>
								<br>
								test_15.htm<br>
　<ol style="text-align: left; margin: 0px; padding-left: 40px; padding-right: 1px; padding-top: 1px; padding-bottom: 1px; background: #e1e7f0">
									<li style="background: #ffffff url('images/code_bg.gif')">
									<code><span style="COLOR: #000000">&lt;br&gt; &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									<font color="#007700">{lang:Ease&nbsp;Template&nbsp;非常棒!}</font> 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&lt;br&gt; &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&lt;a&nbsp;href=&quot;test_15.php&quot;&gt;Chiese&lt;/a&gt;&nbsp;&lt;a&nbsp;href=&quot;test_15.php?lang=en&quot;&gt;English&lt;/a&gt;</span>
									</code></li>
								</ol>
								<br>
								<br>
								默认语言包，根据模板的语言产生的语言包与原始信息相同，请将此文件放入程序目录下的language目录中<br>
								<br>
								default.php<br>
　<ol style="text-align: left; margin: 0px; padding-left: 40px; padding-right: 1px; padding-top: 1px; padding-bottom: 1px; background: #e1e7f0">
									<li style="background: #ffffff url('images/code_bg.gif')">
									<code><span style="COLOR: #000000">
									<span style="COLOR: #0000bb">&lt;? &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #ff8000">/** &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									/*&nbsp;SYSTN&nbsp;ET&nbsp;Language&nbsp;For&nbsp;default &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									*/ &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									/**2008.07.06 &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									中国加油! &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									*/ &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #0000bb">$lang</span><span style="COLOR: #007700">[</span><span style="COLOR: #dd0000">&quot;e0b19b05e5c28de806d92ef5991842e4&quot;</span><span style="COLOR: #007700">]&nbsp;=&nbsp;</span><span style="COLOR: #dd0000">&quot;中国加油!&quot;</span><span style="COLOR: #007700">; 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #ff8000">
									/**2008.07.06 &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									Ease&nbsp;Template&nbsp;非常棒! &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									*/ &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #0000bb">$lang</span><span style="COLOR: #007700">[</span><span style="COLOR: #dd0000">&quot;7ec49c5eb48abf8293354daedb9e2820&quot;</span><span style="COLOR: #007700">]&nbsp;=&nbsp;</span><span style="COLOR: #dd0000">&quot;Ease&nbsp;Template&nbsp;非常棒!&quot;</span><span style="COLOR: #007700">;</span>
									</span></code></li>
								</ol>
								<br>
								<br>
								下面的语言包为翻译后内容，请将此文件放入程序目录下的language目录中<br>
								<br>
								en.php<br>
　<ol style="text-align: left; margin: 0px; padding-left: 40px; padding-right: 1px; padding-top: 1px; padding-bottom: 1px; background: #e1e7f0">
									<li style="background: #ffffff url('images/code_bg.gif')">
									<code><span style="COLOR: #000000">
									<span style="COLOR: #0000bb">&lt;? &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #ff8000">/** &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									/*&nbsp;SYSTN&nbsp;ET&nbsp;Language&nbsp;For&nbsp;default &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									*/ &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									/**2008.07.06 &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									中国加油! &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									*/ &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #0000bb">$lang</span><span style="COLOR: #007700">[</span><span style="COLOR: #dd0000">&quot;e0b19b05e5c28de806d92ef5991842e4&quot;</span><span style="COLOR: #007700">]&nbsp;=&nbsp;</span><span style="COLOR: #dd0000">&quot;Cheer&nbsp;up&nbsp;China!&quot;</span><span style="COLOR: #007700">; 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #ff8000">
									/**2008.07.06 &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									Ease&nbsp;Template&nbsp;非常棒! &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									*/ &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #0000bb">$lang</span><span style="COLOR: #007700">[</span><span style="COLOR: #dd0000">&quot;7ec49c5eb48abf8293354daedb9e2820&quot;</span><span style="COLOR: #007700">]&nbsp;=&nbsp;</span><span style="COLOR: #dd0000">&quot;Ease&nbsp;Template&nbsp;Very&nbsp;Good!&quot;</span><span style="COLOR: #007700">;</span>
									</span></code></li>
								</ol>
								</td>
							</tr>
						</table>
						</td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		</td>
	</tr>
	<tr>
		<td class="style8" style="HEIGHT: 21px">
		<table class="style4" cellSpacing="0" cellPadding="0" align="right" id="table6">
			<tr>
				<td style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: #000000">
				<img height="13" src="images/copyright_left.gif" width="3"></td>
				<td class="style10" style="WIDTH: 240px" background="images/copyright_bg.gif">
				Copyright 2005 - 2008 <a href="http://www.systn.com" target="_blank"><font color="#000000">SYSTN.COM</font></a>&nbsp;&nbsp;&nbsp;</td>
				<td style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: #000000">
				<img height="13" src="images/copyright_right.gif" width="2"></td>
			</tr>
		</table>
		</td>
	</tr>
</table>
